/**
 * Created by 7095 on 2021/6/16.
 */

public with sharing class ContractProjectController {

    public List<ContractProduct__c> contractProducts { get; set; }

    public List<ContractProduct__c> contractName { get; set; }

    public List<ContractProject__c> supportType { get; set; }

    public String dataContractProducts { get; set; }

    public String dataContractName { get; set; }//仪器名称

    public String dataSupportType { get; set; }//费用类型

    public String contractId { get; set; }//合同id

    public ContractProjectController() {
        contractId = System.currentPageReference().getParameters().get('id');
    }

    public void init() {
        contractProducts = [SELECT Name,ProductLine__c,Product__c,SalesPrice__c,Unit__c,Brand__c,Model__c FROM ContractProduct__c WHERE Contract__c ='a0I0k0000052rI8EAI'];
        contractName = [SELECT Id,Name FROM ContractProduct__c WHERE Contract__c =: contractId];

        dataContractProducts = EncodingUtil.urlEncode(JSON.serialize(contractProducts), 'UTF-8');
        dataContractName = EncodingUtil.urlEncode(JSON.serialize(contractName), 'UTF-8');
    }

}